

ENT.Type = "anim"

ENT.PrintName		= ""
ENT.Author			= ""
ENT.Contact			= ""
ENT.Purpose			= ""
ENT.Instructions	= ""

/* function ENT:TrackEntity( ent )

	if ( !ent || !ent:IsValid() ) then return end
	
	local WPos = ent:GetPos()
	WPos.y = 0;
	WPos = WPos + Vector( 10, 0, 400 )
	self.Entity:SetAngles(Angle(90,0,0))
	if (self.Entity:GetPos() - WPos):Length() > 400 then		self.Entity:SetPos(WPos)	Msg("to far away!\n")	end
	
	local v = ent:GetVelocity()
	v.y = 0
	
	local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, WPos.z)

	if (v.z == 0) then
		self.Entity:SetPos( adjustVec )
	end
	
	if (SERVER) then
		self.Entity:SetLocalVelocity( v )
	end
	
	local Ang = ent:GetPos() - WPos
	Ang = Ang:Angle()
	
Ang.Pitch = 0
	self.Entity:SetAngles(Ang)

end
*/
function ENT:TrackEntity( ent ) //Andyvincents code for top view

	if ( !ent || !ent:IsValid() ) then return end
	
	local WPos = ent:GetPos()
	WPos = WPos + Vector( 0, 100, 510 )


	 if (self.Entity:GetPos() - WPos):Length() > 1 then		
	self.Entity:SetPos(WPos)	
	//Msg("DEBUG: Rewnewing Camera Position\n")	
	end
	
	
	local v = ent:GetVelocity()
	
	local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, self.Entity:GetPos().z)

//	if (v.z == 0) then
//		self.Entity:SetPos( adjustVec )
//	end
	
	if (SERVER) then
		self.Entity:SetLocalVelocity( v )
	end
	
	local Ang = ent:GetPos() - WPos
	Ang = Ang:Angle()
	Ang.Pitch = 45
	self.Entity:SetAngles(Ang)

end

